package com.mengpeng.toastutils

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        textView_success.setOnClickListener({
            ToastUtils.onSuccessShowToast( "成功toast")
        })

        textView_error.setOnClickListener({
            ToastUtils.onErrorShowToast( "失败toast")
        })

        textView_default.setOnClickListener({
            ToastUtils.onDefaultShowToast( "默认toast")
        })
        textView_warn.setOnClickListener({
            ToastUtils.onWarnShowToast( "Warn toast")
        })
        textView_info.setOnClickListener({
            ToastUtils.onInfoShowToast( "Info toast")
        })
        textView_custum1.setOnClickListener({
            ToastUtils.onShowToast( "自定义1", 0, R.drawable.toast_custum1_shape)
        })
        textView_custum2.setOnClickListener({
            ToastUtils.onShowToast( "自定义2", R.mipmap.ic_launcher_round,
                    R.drawable.toast_custum2_shape)
        })
    }
}
